# -*- ecoding: utf-8 -*-
# @Author: Wick
# @Time: 2024-02-24 22:27
class Animal:
    def eat(self):
        print("吃---")
    def drink(self):
        print("喝---")
    def run(self):
        print("跑---")
    def sleep(self):
        print("睡---")

class Dog(Animal):
    def bark(self):
        print("叫---")

class Cat(Animal):
    def catch(self):
        print("捕猎---")

class XiaoTianQuan(Dog):
    def fly(self):
        print("会飞")

    def bark(self):  # 参数跟父类不同也会覆盖父类中的方法
        """
        重写父类方法
        :return:
        """
        print("像神一样的交换")
        super().bark()


wangcai = Dog()
wangcai.bark()

xiaotian = XiaoTianQuan()
xiaotian.bark()
xiaotian.fly()
